package com.atguigu.decorator;

public class CoffeeBar {
    public static void main(String[] args) {
        //装饰者模式下的订单，2份巧克力+一份牛奶的LongBlack

        //1.点一份LongBlack
        Drink order = new LongBlack();
        System.out.println("描述："+order.getDes());
        System.out.println("费用:"+order.cost());

        //2.order加入一份牛奶
        order = new Milk(order);
        System.out.println("加入了牛奶："+order.getDes());
        System.out.println("加入了牛奶："+order.cost());

        //3.order加入一份巧克力
        order = new Chocolate(order);
        System.out.println("加入了巧克力："+order.getDes());
        System.out.println("加入了巧克力："+order.cost());

        order = new Chocolate(order);
        System.out.println("加入了巧克力："+order.getDes());
        System.out.println("加入了巧克力："+order.cost());

        System.out.println("==========================================");
        Drink order2 = new DeCaf();
        System.out.println("无因咖啡："+order2.getDes());
        System.out.println("无因咖啡："+order2.cost());
    }
}
